package com.zHan.system.controller.system;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zHan.common.result.Result;
import com.zHan.model.dto.SysLoginLogQueryDto;
import com.zHan.model.system.SysLoginLog;
import com.zHan.system.service.impl.SysLoginLogServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: SysLoginLogController
 * Description: 登录日志管理
 * date: 2023/6/27 0027 20:59
 *
 * @author zHan
 */
@Slf4j
@RestController
@Api(tags = "登录日志管理")
@RequestMapping("/admin/system/sysLoginLog")
public class SysLoginLogController {
    @Autowired
    private SysLoginLogServiceImpl loginLogService;

    /**
     * @param page
     * @param pageSize
     * @param logQueryVo
     * @return
     */
    @ApiOperation(value = "登录日志分页条件查询")
    @GetMapping("/{page}/{pageSize}")
    public Result findPageQueryLoginLog(@ApiParam(name = "page", value = "当前页码", required = true)
                                        @PathVariable Long page,
                                        @ApiParam(name = "pageSize", value = "每页记录数", required =
                                                true)
                                        @PathVariable Long pageSize,
                                        @ApiParam(name = "logQueryVo", value = "查询对象")
                                        SysLoginLogQueryDto logQueryVo) {
        Page<SysLoginLog> pageInfo = loginLogService.selectPageQuery(page, pageSize, logQueryVo);
        return Result.ok(pageInfo);
    }

}
